{$CLEO .cs}
{$use cleo+}
0000:
 
model.Load(#BMYCON) 
model.Load(#m4) 
038B: load_requested_models


const

Found_target =   19@
Random_victims = 10@
end
Found_target = false 
while $onmission >= 1   
wait 0      
    if  00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere -2321.2241 -150.5258 35.5547 radius 100.0 100.0 100.0
    then
 
            if not marker_enabled 1@
            then
               1@ = marker.CreateIconWithoutSphere(37,   -2321.2241, -150.5258, 35.5547)
            end
            if   and
              02A0:   actor $PLAYER_ACTOR stopped
              00FE:   actor $PLAYER_ACTOR sphere 1 in_sphere  -2321.2241 -150.5258 35.5547 radius 4.0 4.0 4.0
            then
                 goto @Target
            end

             wait 100   
          
    else 
            if  marker_enabled 1@
            then
                marker.Disable(1@ )
            end        
            if  marker_enabled 2@
            then
                marker.Disable(2@ )
            end        
        wait 100
    end 
    
 
end 

:Target
show_styled_text "~w~Look for the target" 4000 5
  add_text_label "@hitman" "Go to the construction site, he'll be there for you."
0512: show_permanent_text_box '@hitman'  // If your health reaches zero, you will pass out and you will be treated at the local medical center.

while $onmission >= 1 
wait 0
0208: 13@ = random_float_in_ranges 30.0 80.0
0208: 14@ = random_float_in_ranges 30.0 80.0

04C4: store_coords_to 20@ 21@ 22@ from_actor $PLAYER_ACTOR with_offset 13@ 14@ 0.0
02C0: store_to  23@ 24@ 25@ ped_path_coords_closest_to  20@ 21@ 22@
if Found_target == false 
then
 
end
if  
00FE:   actor $PLAYER_ACTOR sphere 0 in_sphere  -2085.3394 209.3334 35.2168 radius 30.0 30.0 30.0
then 
           Found_target = true 
        
end  
      if  and 
      not is_actor_defined  0@
      Found_target == true  
      then
          0@ = actor.Create(gang6, #BMYCON , 23@, 24@, 25@ )
          actor.Health(0@)= 5000
          actor.GiveWeaponAndAmmo(0@, m4 ,88888)
          actor.WeaponAccuracy(0@)=60
          0446: set_actor 0@ dismemberment_possible 0
          07DD: set_actor 0@ attack_rate 80 // previously known as temper_to 
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 0 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 1 // see ped.dat
          077A: set_actor 0@ acquaintance 4 to_actors_pedtype 6 // see ped.dat
          07FE: set_actor 0@ fighting_style_to 7 moves 6
          05DE: AS_actor 0@ walk_around_ped_path
          081A: set_actor 0@ weapon_skill_to 0
          05E2: AS_actor 0@ kill_actor player1
         0946: set_actor 0@ actions_uninterupted_by_weapon_fire 1

          marker.CreateAboveActor(2@,0@)
          show_styled_text "~r~Target location revealed!~N~~r~Kill the target!" 4000 5
          03E6: remove_text_box

      end
      if is_actor_defined   0@
      then
          if actor.Dead(0@)
          then
              show_styled_text "~y~Target eliminated!~n~~b~Reward~n~~w~$2500" 4000 5
              0109: player $PLAYER_CHAR money += 2500
              018C: play_sound 1052 at 0.0 0.0 0.0
              $HITMAN_DESTROYED += 1 
              $HITMAN_DESTROYED_SF += 1 
              break
          end
      
      end 
end
03E6: remove_text_box

//Cleanup 
if is_actor_defined  0@
then
    actor.RemoveReferences( 0@ )
end 
if  marker_enabled 1@
then
marker.Disable(1@ )
end        
if  marker_enabled 2@
then
marker.Disable(2@ )
end             
model.destroy(#BMYCON) 
model.destroy(#m4) 

terminate_this_custom_script